package com.soft.web;

import java.io.IOException;
import java.util.Random;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class AddPhoneUI extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String id=req.getParameter("id");
		Random rd=new Random();
		int num=rd.nextInt(100);
		String userid=Integer.toString(num);
		HttpSession session =req.getSession();
		session.setAttribute("id", id);
		session.setAttribute("userid", userid);
		
		req.getRequestDispatcher("/WEB-INF/jsp/addphone.jsp").forward(req, resp);
	
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doGet(req,resp);
	
	}
	
}
